import { usenowDate } from '../util/util';


var storage = window.localStorage;

/**
 * 
 * @returns 销售发票list
 */
export function use_xsfp_initcolmun() {
  return [{ show: true, title: "序号", key: "xuhao",width:"2.8rem" },
    { show: true, title: "录入状态", key: "status" ,width:"5rem"},

    { show: true, title: "开票时间", key: "kpsj" ,width:"5rem"},
    { show: true, title: "购买方名称", key: "gmf_mc",width:"15rem" },
    { show: true, title: "购买方识别号", key: "gmf_nsrsbh",width:"9rem" },
    { show: true, title: "销售方名称", key: "xsf_mc" ,width:"8rem"},
    { show: true, title: "销售方识别号", key: "xsf_nsrsbh" ,width:"9rem"},
    { show: true, title: "合计金额", key: "hjje" },
    { show: true, title: "合计数量", key: "hjsl" },
    { show: true, title: "合计税额", key: "hjse" },
    { show: true, title: "价税合计", key: "jshj" },
    { show: true, title: "开票人", key: "kpr" },

    { show: true, title: "备注", key: "bz",width:"12rem",style:{fontSize:"12px"} },
    { show: true, title: "发票附件", key: "fpfj",rendertype:"url" },


  ]
}

/**
 * 
 * @param {*} 销售发票formdata 
 * @returns 
 */
export function use_xsfp_initformdata() {
  //create_time,update_time 插入方法自动拼接 
  var initformdata = {
    id: { ifdb: true, bt: false, value: "", title: 'id', dataIndex: 'id', inputType: "none" },
    djxx_title: { ifdb: false, bt: false, value: "", title: '表单信息', dataIndex: 'djxx_title', inputType: "title_item" },
    create_by: { ifdb: true, bt: false, value: storage.ygxm, title: '创建者', dataIndex: 'create_by', inputType: "input_item", disabled: true },
    create_time: { ifdb: false, bt: false, value: usenowDate(), title: '创建时间', dataIndex: 'create_time', inputType: "date_item", disabled: true },
    update_by: { ifdb: true, bt: false, value: storage.ygxm, title: '修改者', dataIndex: 'update_by', inputType: "input_item", disabled: true },
    update_time: { ifdb: false, bt: false, value: usenowDate(), title: '修改时间', dataIndex: 'update_time', inputType: "date_item", disabled: true },
    gmfxx_title: { ifdb: false, bt: false, value: "", title: '购买方信息', dataIndex: 'gmfxx_title', inputType: "title_item" },
    gmf_mc: { ifdb: true, bt: false, value: "", title: '购买方名称', dataIndex: 'gmf_mc', inputType: "select_item_new",
      customlinewidth: "48.1%",
      datas_key: "datas_kh",
      popup_tansferarr: [
        { origin: "label", target: "gmf_mc" },
        { origin: "value", target: "gmf_nsrsbh" },
      ],
     },
    gmf_nsrsbh: { ifdb: true, bt: false, value: "", title: '纳税人识别号', dataIndex: 'gmf_nsrsbh', inputType: "input_item" },
    xsfxx_title: { ifdb: false, bt: false, value: "", title: '销售方信息', dataIndex: 'xsfxx_title', inputType: "title_item" },
    xsf_mc: { ifdb: true, bt: false, value: "宁波甬舟能源技术股份有限公司", title: '销售方名称', dataIndex: 'xsf_mc', inputType: "readonly" },
    xsf_nsrsbh: { ifdb: true, bt: false, value: "913302251450095912", title: '纳税人识别号', dataIndex: 'xsf_nsrsbh', inputType: "readonly" },
    kpxx_title: { ifdb: false, bt: false, value: "", title: '开票信息', dataIndex: 'kpxx_title', inputType: "title_item" },
    kpr: { ifdb: true, bt: false, value: "", title: '开票人', dataIndex: 'kpr', inputType:"select_item_new",
      datas_key: "datas_ry",
      popup_tansferarr: [
        { origin: "label", target: "kpr" },
        { origin: "value", target: "kprid" }
      ], },
    kprid: { ifdb: true, bt: false, value: "", title: '开票人id', dataIndex: 'kprid', inputType: "none" },
    kpsj: { ifdb: true, bt: false, value: usenowDate(), title: '开票时间', dataIndex: 'kpsj', inputType: "date_item" },
    hjsl: { ifdb: true, bt: false, value: "", title: '合计数量', dataIndex: 'hjsl', inputType: "readonly" },
    hjje: { ifdb: true, bt: false, value: "", title: '合计金额', dataIndex: 'hjje', inputType: "readonly" },
    hjse: { ifdb: true, bt: false, value: "", title: '合计税额', dataIndex: 'hjse', inputType: "readonly" },
    jshj: { ifdb: true, bt: false, value: "", title: '价税合计', dataIndex: 'jshj', inputType: "readonly" },
    bz: { ifdb: true, bt: false, value: "", title: '备注', dataIndex: 'bz', inputType: "input_text_item" },
    fpfj: { ifdb: true, bt: false, value: "", title: '发票附件', dataIndex: 'fpfj', inputType: "upload_fj_item" },
    xtwlxx_title: { ifdb: false, bt: false, value: "", title: '系统物料信息', dataIndex: 'xtwlxx_title', inputType: "title_item" },
    wlmc: { ifdb: false, bt: false, value: "", title: '物料名称', dataIndex: 'wlmc', inputType: "popup_item_datas_mx",
      popup_maintitle: '系统物料', popup_column: [
        { title: "序号", key: "xuhao" },
        { title: "物料名称", key: "wlmc" },
        { title: "物料编码", key: "wlbm" },
        { title: "规格型号", key: "ggxh" }
      ],
      datas_key: 'datas_wl',
      popup_tansferarr: [
        { origin: "wlmc", target: "wlmc" },
      ],
     }



    
  }
  return initformdata
}


/**
 * 
 * @returns 销售发票mxlist columm
 */
export function use_xsfp_mx_column_initformdata() {
  //create_time,update_time 插入方法自动拼接 
  var colmuns = [
    { ifdb: false, bt: false, defalut_v: "", value: "", title: '序号', dataIndex: 'xuhao', inputType: "readonly", width: "80px" },
    { ifdb: true, bt: false, defalut_v: "", value: "", title: 'id', dataIndex: 'id', inputType: "none" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '客户物料名称', dataIndex: 'khwlmc', inputType: "readonly",width: "15vw"  },
    //{ ifdb: true, bt: false, defalut_v: "",value: "", title: '客户物料编码', dataIndex: 'khwlbm', inputType: "input_item",width: "10vw" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '客户规格型号', dataIndex: 'khggxh', inputType: "readonly" ,width: "12vw" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '物料名称', dataIndex: 'wlmc', inputType: "readonly",width: "10vw" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '物料编码', dataIndex: 'wlbm', inputType: "readonly",width: "10vw" },
    {
      ifdb: true, bt: false, width: "18vw", style: { width: "95%", fontSize: "0.6rem" }, defalut_v: "", value: "", title: '规格型号', dataIndex: 'ggxh', inputType: "select_item_new",
      datas_key: "datas_wl",
      popup_tansferarr: [
        { origin: "wlmc", target: "wlmc" },
        { origin: "wlbm", target: "wlbm" },
        { origin: "ggxh", target: "ggxh" },
        { origin: "dw", target: "dw" },
      ]
    },    
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '单位', dataIndex: 'dw', inputType: "readonly" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '数量', dataIndex: 'sl', inputType: "input_number_item" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '单价', dataIndex: 'dj', inputType: "input_number_item" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '金额', dataIndex: 'je', inputType: "input_number_item" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '税率', dataIndex: 'shuil', inputType: "input_number_item" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '税额', dataIndex: 'se', inputType: "input_number_item" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '备注', dataIndex: 'bz', inputType: "input_item" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: 'mainid', dataIndex: 'mainid', inputType: "none" },
   
  ]
  return colmuns
}

/**
 * 
 * @returns 工票单list
 */
export function use_gpd_initcolmun() {
  return [{ show: true, title: "序号", key: "xuhao",width:"2.8rem" },
    { show: true, title: "所属车间", key: "sscj" ,width:"5rem"},
    { show: true, title: "生产日期", key: "scrq"  ,width:"5rem"},
    { show: true, title: "生产人", key: "scr"  ,width:"5rem"},
    { show: true, title: "车间主任", key: "cjzr" ,width:"5rem"},



  ]
}

/**
 * 
 * @param {*} 工票单formdata 
 * @returns 
 */
export function use_gpd_initformdata() {
  //create_time,update_time 插入方法自动拼接 
  var initformdata = {
    id: { ifdb: true, bt: false, value: "", title: 'id', dataIndex: 'id', inputType: "none" },
    djxx_title: { ifdb: false, bt: false, value: "", title: '表单信息', dataIndex: 'djxx_title', inputType: "title_item" },
    create_by: { ifdb: true, bt: false, value: storage.ygxm, title: '创建者', dataIndex: 'create_by', inputType: "input_item", disabled: true },
    create_time: { ifdb: false, bt: false, value: usenowDate(), title: '创建时间', dataIndex: 'create_time', inputType: "date_item", disabled: true },
    update_by: { ifdb: true, bt: false, value: storage.ygxm, title: '修改者', dataIndex: 'update_by', inputType: "input_item", disabled: true },
    update_time: { ifdb: false, bt: false, value: usenowDate(), title: '修改时间', dataIndex: 'update_time', inputType: "date_item", disabled: true },
    sscj: { ifdb: true, bt: false, value: "", title: '所属车间', dataIndex: 'sscj', inputType: "select_item_new",
      datas_key: 'datas_cj',
      popup_tansferarr: [
        { origin: "label", target: "sscj" }
      ]  },
    cjzr: { ifdb: true, bt: false, value: "", title: '车间主任', dataIndex: 'cjzr', inputType: "select_item_new",
      datas_key: 'datas_ry',
      popup_tansferarr: [
        { origin: "label", target: "cjzr" }
      ], },
    scr: { ifdb: true, bt: false, value: storage.ygxm, title: '生产人', dataIndex: 'scr', inputType: "select_item_new",
      datas_key: 'datas_ry',
      popup_tansferarr: [
        { origin: "label", target: "scr" }
      ], },
    scrq: { ifdb: true, bt: false, value: usenowDate(), title: '生产日期', dataIndex: 'scrq', inputType: "date_item" },
    
  }
  return initformdata
}


/**
 * 
 * @returns 工票单mxlist columm
 */
export function use_gpd_mx_column_initformdata() {
  //create_time,update_time 插入方法自动拼接 
  var colmuns = [
    { ifdb: false, bt: false, defalut_v: "", value: "", title: '序号', dataIndex: 'xuhao', inputType: "readonly", width: "80px" },
    { ifdb: true, bt: false, defalut_v: "", value: "", title: 'id', dataIndex: 'id', inputType: "none" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '物料名称', dataIndex: 'wlmc', inputType: "readonly" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '物料编码', dataIndex: 'wlbm', inputType: "readonly" },
    { ifdb: true, bt: false, defalut_v: "",value: "", title: '规格型号', dataIndex: 'ggxh', inputType: "select_item_new", width: "12rem",
      datas_key: 'datas_wl',
      popup_tansferarr: [
        { origin: "wlmc", target: "wlmc" },
        { origin: "ggxh", target: "ggxh" },
        { origin: "wlbm", target: "wlbm" },
      ] },
   { ifdb: true, bt: false, defalut_v: "",value: "", title: '工序', dataIndex: 'gx', inputType:  "select_item_new",
    datas_key: 'datas_gx',
    popup_tansferarr: [
      { origin: "label", target: "gx" }
    ] },
   { ifdb: true, bt: false, defalut_v: "",value: "", title: '完工数量', dataIndex: 'wgsl', inputType: "input_number_item" },
   { ifdb: true, bt: false, defalut_v: "",value: "", title: '完工工时', dataIndex: 'wggs', inputType: "input_number_item" },
   { ifdb: true, bt: false, defalut_v: "",value: "", title: '单价', dataIndex: 'dj', inputType: "input_number_item" },
   { ifdb: true, bt: false, defalut_v: "",value: "", title: '小计', dataIndex: 'xj', inputType: "input_item" },
   { ifdb: true, bt: false, defalut_v: "",value: "", title: '备注', dataIndex: 'bz', inputType: "input_item" },
   { ifdb: true, bt: false, defalut_v: "",value: "", title: 'mainid', dataIndex: 'mainid', inputType: "none" },
  
   
  ]
  return colmuns
}

